package org.zsk.cs.aop.sample.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zsk.cs.aop.sample.Log;
import org.zsk.cs.aop.sample.service.InnerAopService;
import org.zsk.cs.aop.sample.service.UserAop2Service;

/**
 * @author zsk
 * 2021/3/8 下午2:51
 */
@Service
public class UserAop2ServiceImpl implements UserAop2Service {
    @Autowired
    InnerAopService innerAopService;

    @Override
    public String save(String user) {
        System.out.println("保存用户信息");
        innerCall("zsk13");
        innerAopService.innerCall("zsk13");
        if ("a".equals(user)) {
            throw new RuntimeException();
        }
        return user;
    }

    @Override
    public String innerCall(String innerArgs) {
        System.out.println("UserAop2Service-innerCall-"+innerArgs);
        return innerArgs;
    }

    @Log(value = "test")
    @Override
    public void testAnnotationAop(String taskId,String actId,String procInstId) {
        System.out.println("testAnnotationAop");
    }
}
